package com.demo.component;

import com.demo.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created by IntelliJ IDEA.
 * User: zm
 * Date: 2023/2/14
 */
@Component
public class StudentBeans {
    @Bean
    public Student student(){
        Student stu = new Student();
        stu.setId(1);
        stu.setName("张三");
        stu.setAge(18);

        return stu;
    }
}
